package tm.model
{
	import tm.view.ListPositions;
	import tm.view.ListTaskDetails;	
	import tm.vo.Users;
	import tm.vo.Tasks;
	
	import mx.collections.ArrayCollection;
	    
    [Bindable]
   /**
    * Implements Singleton pattern and stores model data for the MVC architecture
    * of the Presentation Tier.
    */          
    public final class ModelLocator
    {
        /**
         * The currently logged in user.
         */                   
        public var user:Users = new Users();
                
        /**
         * The currently selected task.
         */                   
        public var task:Tasks = new Tasks();
        
        /**
         * The array of category selections.
         */                   
        public var categorySelections:ArrayCollection = new ArrayCollection();

        /**
         * Reference to the List Positions view
         */
        public var viewListPositions:ListPositions;
        
        /**
         * Reference to the Task Details view
         */
        public var viewTaskDetails:ListTaskDetails;
                                                       
        /**
         * Defines the Singleton instance of the Application ModelLocator
         */
        private static var instance:ModelLocator;

        public function ModelLocator(access:Private) {
            instance = this;
        }
         
        /**
         * Returns the Singleton instance of the Application ModelLocator
         */
        public static function getInstance() : ModelLocator {
            if (instance == null)
            {
                instance = new ModelLocator( new Private() );
            }
            return instance;
        }
    }
}

/**
 * Inner class which restricts constructor access to Private
 */
class Private {}




